package com.pingsky.apm.agent.core.util;

import com.pingsky.apm.agent.api.log.PLogger;
import com.pingsky.apm.agent.api.log.PLoggerFactory;

import java.io.File;
import java.io.FileInputStream;
import java.util.Properties;

public class FileUtil {
    private final static PLogger logger = PLoggerFactory.getLogger(FileUtil.class);

    public static Properties loadProperties(File configFile) {
        Properties properties = new Properties();
        try {
            FileInputStream configFileStream = new FileInputStream(configFile);
            properties.load(configFileStream);
        } catch (Exception e) {
            logger.warn("load config file:{} error", configFile.getAbsolutePath(), e);
        }
        return properties;
    }
}
